# 查找GTest包
find_package(GTest REQUIRED)

# 添加测试源文件
file(GLOB_RECURSE TEST_SOURCES "*.cpp")

# 创建测试可执行文件
add_executable(unit_tests ${TEST_SOURCES})

# 链接GTest和项目库
target_link_libraries(unit_tests
    PRIVATE
        GTest::GTest
        GTest::Main
        ${PROJECT_NAME}
)

# 添加测试
add_test(NAME unit_tests COMMAND unit_tests) 